GdkWin32: ignore invalid client rects
authorG.Willems <g.willems.dev@laposte.net>
Tue, 19 Sep 2023 18:29:04 +0000 (20:29 +0200)
committerMat <mail@mathias.is>
Fri, 3 Nov 2023 20:51:47 +0000 (22:51 +0200)
commitc69e19c9c50dec167af9a8dda61f118cd87b0a32
tree0dd4d6e9b208365aa1d4123480767e3963ef8a10
parentfe9abc78c0961e99ffc9008dd38ee43b5c284975
GdkWin32: ignore invalid client rects

Gdk-Win32 uses GetClientRect() internally to query the surfaces coordinates,
but this API may fail in some transient contexts (observed when iconifying
a maximized window).
Check if the rect area is null, and don't update the surface position in
that case. This will keep the current surface size, until Win32 notifies
the new valid window state later.
This prevents using a nulled next_layout for toplevel size computation,
which would break widgets allocation once notified on gtk side.

Fixes #5724
Closes #5724
gdk/win32/gdksurface-win32.c